Methods and devices for detection of malware

ABSTRACT

An apparatus includes a database configured to store a collection of files. The apparatus also includes a counter module configured to calculate a frequency of a data feature in the collection of files. The apparatus also includes a signature generation module operatively coupled to the counter module. The signature generation module is configured to generate a malware signature based on the frequency of the data feature in the collection of files. The malware signature includes an indication of one or more criterion for the data feature, and the malware signature is associated with a malware. The apparatus also includes a communication module configured to receive a target file, and a detection module operatively coupled to the communication module. The detection module is configured to classify the target file as the malware when the target file meets the one or more criterion of the malware signature.

CROSS-REFERENCE TO RELATED APPLICATIONS

This applications claims priority to U.S. Provisional Application No. 62/000,305 titled “METHODS AND DEVICES FOR DETECTION OF MALWARE”, filed May 19, 2014, the entire disclosure of which is incorporated herein by reference.

GOVERNMENT LICENSE RIGHTS

This invention was made with government support under contract no. FA8750-10-C-0169 awarded by the Defense Advanced Research Projects Agency (DARPA). The Government has certain rights in the invention.

BACKGROUND

Some embodiments described herein relate generally to generation of signatures for malware detection.

Malware, short for malicious software, is software designed to infiltrate a computer system without the owner's informed consent. The expression is a general term used by computer professionals to mean a variety of forms of hostile, intrusive, or annoying software and/or program code. Malware presents security risks and/or issues for computer systems.

The problem of identifying malware is difficult because a small fraction of files on computing devices, either at rest or in motion, are actually malware, let alone malware that are similar to any other kind or form of malware sample. Accordingly, even detection techniques that have a very low false positive rate typically generate large volumes of false positives when tasked with analyzing millions of files.

Accordingly, a need exists for automatic malware capability identification using on a signature, the signature generated based on specified malware sample(s), which can detect similar malware samples.

SUMMARY

In some embodiments, an apparatus includes a database configured to store a collection of files. The apparatus also includes a counter module implemented in at least one of a memory or a processing device, the counter module operably coupled to the database. The counter module is configured to calculate a frequency of a data feature in the collection of files. The apparatus also includes a signature generation module operatively coupled to the counter module. The signature generation module is configured to generate a malware signature based on the frequency of the data feature in the collection of files. The malware signature includes an indication of one or more criterion for the data feature, and the malware signature is associated with a malware. The apparatus also includes a communication module configured to receive a target file, and a detection module operatively coupled to the communication module. The detection module is configured to classify the target file as the malware when the target file meets the one or more criterion of the malware signature.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A is a schematic diagram that illustrates a malware detection device configured to detect malware in a target file, according to an embodiment.

FIG. 1B is an example illustration of the malware detection device of FIG. 1A in a typical use setting, according to an embodiment.

FIG. 2 is a method of determining whether a target file is malware, according to an embodiment.

FIG. 3 is an example method of malware detection, according to an embodiment.

FIG. 4 is an example plot of real feature counts vs. approximate feature counts, illustrating Morris Counting, according to an embodiment.

FIG. 5 is an example plot illustrating accuracy of a string noise filtering approach based on a decision threshold employed by a Naïve Bayes binary classifier that evaluates whether a string of characters should be considered to be natural language or not.

FIG. 6 is an example malware signature, according to an embodiment.

DESCRIPTION

As used herein, the singular forms “a,” “an” and “the” include plural referents unless the context clearly dictates otherwise. Thus, for example, the term “a communication module” is intended to mean a single module or a combination of modules.

In some embodiments, an apparatus includes a database configured to store a collection of files. The apparatus also includes a counter module implemented in a processing device or a memory. The counter module is operably coupled to the database and is configured to filter the collection of files for the data feature to identify a set of filtered files. The counter module is also configured to calculate a frequency of a data feature in the set of filtered files. The apparatus also includes a signature generation module configured to generate a malware signature based on the frequency of the data feature in the set of filtered files. The malware signature includes one or more criterion for the data feature and is associated with a malware. The apparatus also includes a communication module configured to receive a target file, and a detection module configured to classify the target file as the malware when the target file meets the one or more criterion of the malware signature.

In some embodiments, a non-transitory processor-readable medium stores code representing instructions to be executed by a processor. The code includes code to cause the processor to receive a collection of files, and calculate a frequency of each data feature of a set of data features in the collection of files. The code also includes code to cause the processor to receive a selection of malware files from the collection of files. The selection of malware files is associated with a malware. The code also includes code to cause the processor to calculate a frequency of each data feature from the set of data features in the selection of malware files. The code also includes code to cause the processor to generate a malware signature based on the frequency of each data feature in the collection of files and based on the frequency of each data feature in the selection of malware files. The malware signature includes an indication of a criterion for one or more data features from the set of data features, and is associated with the malware. The code also includes code to cause the processor to receive a target file and classify the target file as the malware when the target file meets the criterion of the malware signature. The code also includes code to cause the processor to transmit an indication of the classification of the target file as malware. The indication includes one or more recommended actions.

FIG. 1A is a schematic diagram of a malware detection device 100 configured to identify whether a target file is malware based on data features of the target file. The file can be in any suitable format, including, but not limited to, an executable, a binary file, an assembly language file, a file derived therefrom, and/or the like. The term “data feature” as used herein with reference to a file, is intended to encompass any recognizable and/or detectable aspect of the file including, but not limited to, text in the file, a byte sequence in the file, a textual byte sequence in the file, a function call in the file, a functionality of the file, a capability of the file, a byte sequence in the file, a bit sequence in the file and combinations thereof. Examples of data features include, but are not limited to, keywords (such as “FindWindow”, “PrintWindow”, “screenshot”, etc.), Application Programming Interface (API) symbols, DLL file import functions, functions for accessing and/or referencing registry keys, and/or the like.

The term “functionality” and/or “capability” as used herein with reference to a file, is intended to encompass any process(es), step(s), executable action(s), and/or the like that the file can be capable of performing when executed. The functionality can include high level actions (i.e., by a high level programming language) and/or low level actions (i.e., by low level programming, such as assembly language programming). Example capability/functionality can be “implements keystroke logging,” “turns on webcam,” “takes screenshots of user's desktop,” “communicates via Internet Relay Chat,” and/or the like. In some embodiments, the capability/functionality can be inferred, as generally disclosed in U.S. patent application Ser. No. 14/212,659 titled “METHODS AND APPARATUS FOR DETECTION OF FUNCTIONALITY”, filed Mar. 14, 2014, the entire disclosure of which is incorporated herein by reference.

In some embodiments, the malware detection device 100 is configured to identify whether the target file is a specific type of malware based on a signature associated with and/or corresponding to the specific type of malware. In some embodiments, the signature can be user specified. In some embodiments, and as will be explained in more detail below, the signature can be generated based on the number of times one or more data features are present in a collection of files.

The malware detection device 100 can be any device with certain data processing and/or computing capabilities such as, for example, a server, a workstation, a compute device, a tablet, a mobile device, and/or the like. As shown in FIG. 1A, the malware detection device 100 includes a processor 110, a memory 160, input/output interfaces 180, and/or other component(s) (not shown in FIG. 1A). FIG. 1A also illustrates that the malware detection device 100 includes a database 170. In other embodiments, the database can be external to the malware detection device but communicatively coupled to the malware detection device by, for example a network. In yet other embodiments, the database 170 and the memory 160 can be the same.

The memory 160 can be, for example, a Random-Access Memory (RAM) (e.g., a dynamic RAM, a static RAM), a flash memory, a removable memory, and/or so forth. In some embodiments, instructions associated with performing the operations described herein (e.g., fault detection) can be stored within the memory 160 and executed at the processor 110.

The processor 110 can be any element configured to execute program code, such as a general purpose processor, an application-Specific Integrated Circuit (ASIC), a Programmable Logic Device (PLD), a Digital Signal Processor (DSP), a field-programmable gate array (FPGA), and/or the like, and combinations thereof, The processor 110 includes a communication module 120, a database module 124, a counter module 128, a signature generation module 132, a detection module 136, and/or other module(s) (not shown in FIG. 1A).

Each module in the processor 110 can be any combination of hardware-based module (e.g., a field-programmable gate array (FPGA), an application specific integrated circuit (ASIC), a digital signal processor (DSP)), hardware-based module executing software (e.g., a module of computer code stored in the memory 160 and/or executed at the processor 110), and/or a combination of hardware- and software-based modules. Each module in the processor 110 is capable of performing one or more specific functions/operations as described in further detail with respect to FIG. 1A. In some embodiments, the modules included and executed in the processor 110 can be, for example, a process, application, virtual machine, and/or some other hardware and/or software module (stored in memory and/or executing in hardware). The processor 110 can be any suitable processor configured to run and/or execute those modules.

In some embodiments, the processor 110 can include more or less modules than those shown in FIG. 1A. In some embodiments, the malware detection device 100 can include more components than those shown in FIG. 1A. In some embodiments, the malware detection device 100 can include or be coupled to an output device (e.g., a printer, a monitor, a speaker, a display device such as a touch screen, etc.), such that an output of the malware detection device (e.g., an indication of whether the target file is malware) can be presented to a user via the output device.

As illustrated in FIG. 1B, the malware detection device 100 can be in communication with one or more source devices 112A-112C, which include the collection of files. The malware detection device 100 can be operated and controlled by a user device 114 such as, for example, a compute device associated with an operator, an administrator, a device associated therewith, and/or the like.

In some embodiments, as shown in FIG. 1B, a network 190 operatively couples the malware detection device 100 to other entities in the network 190, such as the source devices 112A-112C and/or (when the user device is remote) the user device 114. The network 190 can be any type of network that can operatively connect and enable data transmission between the malware detection device 100 and other entities in the network 190. The network 190 can be, for example, a wired network (an Ethernet, a local area network (LAN), etc.), a wireless network (e.g., a wireless local area network (WLAN), a Wi-Fi network, cellular network, etc.), or a combination of wired and wireless networks (e.g., the Internet, etc.). While shown and described as a single network, in other embodiments, the network can be multiple networks connected together to form a larger network (e.g., the Internet).

In some embodiments, the communication module 120 can be configured to receive one or more files from the source devices 112A-112C via the network 190, such as a collection of files, a target file, and/or the like. In some embodiments, the communication module 120 can be configured to search the network 190 (i.e., the devices within the network 190 and/or operatively coupled to the network 190) for files, on-demand or periodically. In some embodiments, the communication module 120 can be configured to search the network 190 via any suitable approach for the files, including, but not limited to, crawling/spidering (e.g., browses the internet, such as for the purpose of Web indexing), tracking (e.g., tracking changes to websites over time), scraping (e.g., extracting information from websites), and/or the like. In some embodiments, the communication module 120 is configured to filter, organize, modify and/or otherwise manipulate the search results in any suitable manner. In some embodiments, the communication module 120 can be further configured to receive files from a user of the malware detection device 100. For example, a user can provide a malware sample to the malware detection device 100. In some embodiments, the communication module 120 can be configured to receive the collection of files, and to send a signal (e.g., to the database module 124) to store the collection of files in the database 170 and/or the memory 160.

In some embodiments, the database module 124 can be configured to receive the one or more files from the communication module 120, and to store the files as a collection of files, such as in the database 170 and/or the memory 160. In some embodiments, the database module 124 is further configured to generate a database index of the files.

In some embodiments, the counter module 128 can be configured to count and/or determine the frequency of occurrence of one or more data features in the collection of files, though it is understood that the term “collection of files” is intended to encompass any subset thereof. The one or more data features can be pre-specified (e.g., a user can specify a data feature, and the collection of files are searched for the user-specified data feature), or can be determined based on the collection of files itself, or combinations thereof. Explained herein with reference to a single data feature for simplicity, in some embodiments, the count for the data feature can be a true or an exact measure of the frequency of the data feature. In other embodiments, the count for the data feature is an approximate measure that may or may not be equal to an exact or true measure. In other embodiments, the count for the data feature is an exact count (i.e., can be deterministic). In some embodiments, the count is a probabilistic measure for the data feature in the collection of files. Any suitable approximation and/or probabilistic technique can be employed for determining the count of the data feature in the collection of files including, but not limited to, an approximate counting algorithm that increments the count based on a probabilistic event, that determines whether a file should be counted based on the probability of the file having the data feature, and/or the like.

In some embodiments, the count is not the exact, true, or approximate measure, but a numerical equivalent thereof. For example, in some embodiments, the count is the logarithm value of an exact, true, or approximate measure. In this manner, large counts can be calculated yet maintained in smaller data structures. As discussed below, the count can be stored as a single base value (B) and an exponent value (E) and the count value at any give time can be represented as B^(E). The exponent value can be incremented when a file is deemed to include the data feature. In some embodiments, the exponent value is initially set to zero, and is incremented with a probability based on the value of the exponent itself. For example, in some embodiments, the exponent is initially set to zero, and is incremented with a probability of 2^(−exponent) when a file is deemed to include the data feature. As an example, an exponent is initially set to 0, and is incremented to one with a probability of 2^(E) (i.e., 1 with E=0) when a file is deemed to include the data feature. Thus, once an initial data feature is identified, the exponent is incremented to 1 and the count value is B¹. The next instance a data feature is located and the exponent is incremented to two with a probability of 2⁻¹ (i.e., 0.5) when another file is deemed to include the data feature. Similarly stated, the exponent is only incremented 50% of the time. Once the exponent is incremented, the count value is B². This process repeats as the exponent increases.

In some embodiments, the exponent value can be specified by a fixed number of bits, such as, for example, 8 bits. In the case of 8 bits, the exponent value can be incremented up to 256. The base value can be selected to tune the granularity of the count. For example, a counter with a base value of 1.04 and an 8-bit exponent value (maximum count value of 1.04^256=22936) is relatively more accurate/granular than one with a base value of 1 and an 8-bit exponent value (maximum count value of 2^256); the latter, however, can count to a relative higher value. The probability that the count is incremented can be based on the 2^(−count) parameter discussed above.

In some embodiments, the approximation and/or probabilistic counting technique can be lossy in nature; i.e., there is some loss in count accuracy, which is offset by the gains in speed, as well as lowered computational and/or memory requirements. For example, a Morris Counter can be used to count for the data feature(s) over a large collection of files numbering in the hundreds, thousands, and even millions. In some embodiments, the Morris Counter can be stored as a Bloom Filter.

In some embodiments, the counter is designed as a data structure (such as a vector) that can be used to perform a lookup on whether a file can be classified as having the data feature, and thereby counted. In some embodiments, the data structure of the counter represents an indexed series of bits initially set to zero. In some embodiments, the data structure can be made representative of one or more data features (also referred to as a “set of data features”) by adding an indication of the data features to the data structure. In some embodiments, the data features are counted using the data structure in the following manner: the data feature is transformed one or more times, and the bits corresponding to the results of the transformation are used as indices into the data structure (e.g., a Bloom filter), such that the data feature's counter can be retrieved and/or manipulated. For example, transformation of the data feature in the file using a hashing function can yield an identifier, and a lookup of the identifier in the data structure can indicate whether the data feature should be counted. In some embodiments, the transformation includes one or more hashing functions. In some embodiments, the number of hashing functions employed depends on the size of the data structure (e.g., size of a vector). In some embodiments, the hashing functions employed includes simple hash, cryptographic hash, Murmur hash, Jenkins hash, Fowler-Noll-Vo (FNV) hash, and/or the like, and combinations thereof.

In some embodiments, filtering the collection of files for the data feature can include querying whether the file maps onto the data structure by transforming the file using the same transformations used to add the data features to the data structure. In some embodiments, the transformations include hash functions, and the collection of files is hashed to determine mapping onto the data structure. In some embodiments, a file is deemed to include the data feature if it maps onto the data structure of the counter; i.e., if the results of transforming the file provides index values for the data structure that are all set to 1. In this manner, a file likely includes the data feature if it maps onto the data structure, and definitively does not include the data feature if it does not map onto the data structure (i.e., if the results of transforming the file provides index values for the data structure, at least one of which is set to 0). In some embodiments, for example, a Bloom Filter can be employed as the data structure. In other examples, an associative array, such as a hash table chained with linked lists, can be employed to store data feature counts.

In some embodiments, the counter module 128 can be further configured to filter the collection of files for the data feature based on approximation and/or probabilistic techniques. In some embodiments, the approximation and/or probabilistic filtering technique can be lossy in nature; i.e., there is some loss in filtering accuracy. As an example, in some embodiments, a classification approach based on the Bayes theorem, such as a naïve Bayes classifier, can be employed by the counter module 128 to filter the collection of files. In some embodiments, the filter indicates whether a file either definitely does not have the data feature(s) or may have the data feature(s). For example, such a naïve Bayes classifier can be used to identify noise vs. natural language in a document. In such an example, the noise would be filtered out and only natural language results are used and/or counted.

In some embodiments, both a counter and a filter can be employed. In some embodiments, at least one of the counter and the filter employs a probabilistic technique. In some embodiments, the filtering can be performed prior to or subsequent to counting the frequency of occurrence of the data feature. In some embodiments, both the counter and the filter can use probabilistic techniques. As an example, the filter can be a Naïve Bayes filter, and the counter can be based on a Bloom Filter, a Morris Counter, or both. As another example, in some embodiments, the data structure of the counter, as described above, can be modified to include more than one bit at each index position, and to use all the bits at each position for counting. In this manner, the filtering aspect can determine whether a file maps onto the data structure (e.g., when the file likely includes the data feature), and the counting aspect can determine, if a file maps onto the data structure, whether the counter is updated based on its previous value. As another example, multiple counters/data structures of varying sizes can be employed, and transitioning successively from the largest data structure to the smallest data structure can performed based on a probabilistic counting method. As yet another example, a hybrid approach can be employed that combines the last two examples, where multiple counters/data structures are employed. In such an example, each counter can have more than one bit at each index position that is used for probabilistic counting, and the transition between counters/data structures is performed based on the same or a different probabilistic counting approach.

Examples of such combined probabilistic techniques for counting include Morris Counters, Morris Bloom Counters, Transition Bloom Counters, Transition Morris Bloom Counters, and/or the like. Generally, such counters that act on probabilistic representations of sets of data, such as the data features in the collection of files, provide at least two significant benefits: they can yield large gains in 1) data structure space and 2) algorithm speed, in return for a small loss in accuracy. Such probabilistic counting techniques allow, for example, data features such as windowed sequences of bytes extracted from the collection of files, to be counted at scale on systems such as personal computing systems having ordinary processing ability. Such scalable, probabilistic counting techniques are of particular relevance to representing malware features because, given the obfuscation employed by malware authors, it can be beneficial to represent malware artifacts using multiple kinds of data features, which can be quite numerous. For example, if a malware program has 10 megabytes of data, it can have as many as 10 million data features (e.g., windowed data byte features).

In some embodiments, the signature generation module 132 can be configured to generate a malware signature (also termed a “detection model”), such as for a specific malware, based on the frequency of the data feature in the collection of files and/or counts associated with the one or more data features in the collection of files, as described in more detail below. In some embodiments, the signature generation module 132 can be configured to receive a selection of malware files from the collection of files (i.e., a subset of the collection of files). The malware files can be a subset of the collection of files and can be associated with the specific malware. The term “malware file” as used herein for purposes of specifying a selection of malware files, is used to denote a file known to be the specific malware, likely to be the specific malware, or specified by a user to be malware. In some embodiments, the user specifies the selection of malware files.

The signature generation module 132 can be further configured to determine a frequency of occurrence of data features in the malware files (e.g., in concert with the counter module 128). For simplicity, assume the malware files include a single data feature, and f_(m) denotes the frequency/count of the data feature in the malware files. The signature generation module 132 can be further configured to determine, and/or receive from the counter module 128, the frequency/count of occurrence of the single data feature in the collection of files (say f_(all)), which includes the malware files and non-malware files. The signature generation module 132 can be further configured to determine the probability that the feature is discriminative for the specific malware as p_(m)=f_(m)/f_(all). The probability measure p_(m) is a value between 0 and 1, where a value close to 1 indicates that the single data feature is found predominantly in the malware files. Accordingly, a file having the single data feature has a strong probability of being the specific malware (its p_(m) is close to 1).

In some embodiments, the signal generation module 132 is configured to generate the malware signature based on a likelihood that the data feature is indicative of the malware associated with the malware signature. In some embodiments, the signature generation module 132 can be further configured to generate the signature for the specific malware from the probability measures for each data feature in the malware files in any suitable manner. In some embodiments, the signature includes a specification of one or more data features that are present in the target file. In some embodiments, the signature includes one or more criterion for the specified data features. For example, in some embodiments, the signature can specify that, Feature A (e.g., a specified byte sequence) must be present in the target file at least twice for that target file to be classified as the specific malware. In some embodiments, the signature includes a specification of an interrelationship between two or more data features specified in the signature. For example, the signature can specify that if Feature A and Feature B are included in the target file within n words of each other, the target file can be classified as the specific malware. In some embodiments, a data feature is included in the signature if it meets one or more criterion, such as a measure of likelihood that the target file is malware. For example, a data feature is included in the signature if the probability measure p_(m) for the data feature crosses a threshold value, such as at least 0.6.

In some embodiments, the signature generation module 132 can be further configured to include one or more data features from the malware files in the signature based on a decision tree. In some embodiments, the signature generation module 132 can be further configured to include one or more data features from the malware files in the signature based on a probabilistic approach for clustering, classification, inference, and/or the like. In some embodiments, the probabilistic approach assumes the independence of the data features from each other; i.e., the likelihood of whether a file includes a particular data feature can be unrelated to the presence or absence of any other data feature. As an example, a classifier based on a Naïve Bayes model can be employed. As another example, a two-layer Bayesian Network based on Noisy-OR gates can be employed, with one layer defined as features that are highly discriminative of malware and a second layer containing a single node, the “is malware” Bernoulli distributed node. As yet another example, an automatically generated decision tree can be used, such that splits in the decision tree are generated on data features that are both common in the target malware (e.g., the malware files) and uncommon in the population of software (e.g., in the collection of files). When probabilistic approaches are used for determining the frequency of the one or more data features in the collection of files, benefits of the approaches described herein provide for improved signature construction based on potentially millions of features across millions of files, thereby accounting for the diversity of malware, without significant computational overhead.

In some embodiments, a user can manually specify that a data feature, found in the malware files or otherwise, should be included in the signature. In this manner, the signature can include data features either based on one or more automatically generated criterion, or manually specified by the user, or combinations thereof.

In some embodiments, the detection module 136 can be configured to receive a test/target file, such as from a user of the malware detection device 100 or via the network (e.g., via the I/O 180 or via the communication module 120), and can be further configured to identify and/or classify whether the test file is malware by comparing the test file against one or more signatures (generated by the signature generation module 132, as described above). In some embodiments, the test file is deemed to be a specific malware if the test file includes one or more of the data features in the signature for the specific malware. In some embodiments, the test file is deemed to be a specific malware if the test file includes one or more of the data features satisfying one or more criterion specified in the malware signature for the specific malware. In some embodiments, the test file is deemed to be a specific malware if the test file includes one or more of the data features satisfying an interrelationship specified in the signature for the specific malware.

In some embodiments, the detection module 136 can be configured to infer a measure of likelihood of whether the target file is the specific malware based on the signature corresponding to and/or associated with the specific malware. Said another way, the measure can be predictive, and it is not necessary for the target file to be the specific malware. The measure of likelihood can be established (for example) based on the extent to which the target file satisfies, maps, and/or otherwise meets the requirements set out in the signature. In some embodiments, the measure can be at least one of a qualitative measure (e.g., a descriptive indicator of the purported functionality), a binary measure (e.g., a yes/no indicator), a probabilistic measure (e.g., a number between 0 and 1, including values and sub ranges in-between), a percentage measure (e.g., greater than 50%, less than 15% chance, between 20-25% chance, and/or the like), and/or the like.

In some embodiments, the detection module 136 can be further configured to take one or more actions based on identifying whether the test file is malware, including transmitting an indication of the result (e.g., that of the classification of the target file as the malware) to a user in any suitable format (e.g., text, graphic, audio, video, and/or the like). In some embodiments, the indication can include a recommended action such as, for example, when the indication communicates that the file is identified as potential malware, and can include a recommendation to delete the file, to run an anti-malware application, to automatically remove the file, to automatically quarantine the file, and/or the like.

FIG. 2 illustrates a method 200 for evaluating whether a target file is malware, according to an embodiment. Explained with reference to the malware detection device 100, at 210, a collection of files is received and/or otherwise retrieved from the database 170 and/or the memory 160. At 220, a frequency of each data feature of a set of data features in the collection of files is counted. In some embodiments, a probabilistic approach is used for counting the data features in the collection of files. In some embodiments, the probabilistic approach includes a Morris Counter. In some embodiments, the probabilistic approach includes a Bloom filter. In some embodiments, the probabilistic approach includes a Morris Bloom Counter (i.e., combines a Morris Counter stored as a Bloom Filter).

At 230, a selection of malware files from the collection of files is received. At 240, a frequency of each data feature of the set of data features in the selection of malware files is counted. At 250, a malware signature is generated based on the frequency of each data feature in the collection of files and based on the frequency of each data feature in the selection of malware files. The malware signature is associated with the malware and includes an indication of a criterion for one or more data features of the set of data features.

At 260, a target file is received. At 270, the target file is compared against the signature to identify whether the target file is the specific type of malware, and the target file is classified the target file as the malware when the target file meets the criterion of the malware signature. In some embodiments, identifying whether the target file is the specific type of malware includes calculating a likelihood that the target file is the specific type of malware.

At 270, an indication of the classification of the target file as malware is transmitted (e.g., to a user interface for presentation to a user). The indication can include one or more recommended actions and/or one or more automatic actions.

FIG. 3 illustrates an example approach to malware detection in a file of interest 310. A database of files 320, such as the database 170 and/or the memory 160, or even the sources 112A-112C (see FIG. 1B), form the basis for generating signatures for specific types of malware. The database can potentially contain millions of files, spanning millions of data features. At 330, approximate and/or probabilistic feature counting can be performed over the millions of files. At 340, signatures or detection models for a specific type of malware can be created based on the feature counting for the millions of files, as well as based on feature counting for similar files for the specific malware. The file of interest can then be compared against the detection models to determine of the file is malware.

In some embodiments, for example, malware signature generation can be reasoned about in terms of feature frequencies (e.g., frequency of data features). In some instances, rare features found in a malware sample, assuming they are not randomization/compression/encryption artifacts, can be the best features for detection. An example of a rare feature can be a printable string extracted from files that is 1) relatively rare in the population of software and 2) is genuine natural language (i.e., is not an artifact of code, ciphertext and/or compressed data). One (first) problem is there can be an unlimited number of features and an unlimited number of observations, yet limited memory and CPU resources. For example, there can be 5.1 billion unique printable string features for a 30 million sample (e.g., in a collection of files) dataset. Another (second) problem is that some features may be random artifacts that occur in one variant of a malware, but not in others.

In some embodiments, a solution to the first problem can be automatic signature generation using Morris-Bloom Counting as described herein. Morris counting is used for compact approximation of feature counts is achieved by storing/counting exponent values (see FIG. 4). The exponent value can be incremented by one, and/or any other suitable number, in a randomized manner so as to approximate the true count. In some embodiments, an adapted Bloom filter is used for indexing of the Morris counter. Such Bloom filters yield no false positives, but are prone to false negatives. In some instances, the indexing can be done using an 8-bits per register and a hash function, employing a 32 MB data structure.

In some embodiments, a solution to the second problem, for the specific artifact that is printable string compression, is filtering printable string compression artifacts using a Naïve Bayes character trigram model. Generally, strings are sequences of printable characters that can be extracted from binary files. Strings in malware can contain signs of the file being malware such as an indication of a malware family, an indication of a time of malware generation, and/or the like. Naïve Bayes is a statistical model that can be used for binary classification. In some instances, a Naïve Bayes model can be trained on trigrams extracted from natural language documents, so that the model can recognize natural language. In some embodiments, the Naïve Bayes approach can model noise as a uniform distribution over all possible character trigrams. In some embodiments, the natural language documents can include at least a portion of the collection of files. The probability that each printable string is either technical language or “noise” can then be inferred. The result is an accurate model (see FIG. 5) for filtering compression/encryption/binary noise from printable strings. FIG. 6 illustrates the resulting automatically generated signature. FIG. 5 illustrates an example where modifying a “decision threshold”, i.e., a threshold for the probability value of a Naïve Bayes model that a string is natural language, can affect precision 510 of the model. Here, increasing decision threshold values lead to increasing precision 510, while leading to a minor drop in recall 520 (i.e., the true positive rate of accurate detection/classification/filtering).

Some embodiments described herein relate to a computer storage product with a non-transitory computer-readable medium (also can be referred to as a non-transitory processor-readable medium) having instructions or computer code thereon for performing various computer-implemented operations. The computer-readable medium (or processor-readable medium) is non-transitory in the sense that it does not include transitory propagating signals per se (e.g., a propagating electromagnetic wave carrying information on a transmission medium such as space or a cable). The media and computer code (also can be referred to as code) may be those designed and constructed for the specific purpose or purposes. Examples of non-transitory computer-readable media include, but are not limited to: magnetic storage media such as hard disks, floppy disks, and magnetic tape; optical storage media such as Compact Disc/Digital Video Discs (CD/DVDs), Compact Disc-Read Only Memories (CD-ROMs), and holographic devices; magneto-optical storage media such as optical disks; carrier wave signal processing modules; and hardware devices that are specially configured to store and execute program code, such as Application-Specific Integrated Circuits (ASICs), Programmable Logic Devices (PLDs), Read-Only Memory (ROM) and Random-Access Memory (RAM) devices. Other embodiments described herein relate to a computer program product, which can include, for example, the instructions and/or computer code discussed herein.

Examples of computer code include, but are not limited to, micro-code or micro-instructions, machine instructions, such as produced by a compiler, code used to produce a web service, and files containing higher-level instructions that are executed by a computer using an interpreter. For example, embodiments may be implemented using Java, C++, .NET, or other programming languages (e.g., object-oriented programming languages) and development tools. Additional examples of computer code include, but are not limited to, control signals, encrypted code, and compressed code.

While various embodiments have been described above, it should be understood that they have been presented by way of example only, and not limitation. Where methods and/or schematics described above indicate certain events and/or flow patterns occurring in certain order, the ordering of certain events and/or flow patterns may be modified. While the embodiments have been particularly shown and described, it will be understood that various changes in form and details may be made. 

What is claimed is:
 1. An apparatus, comprising: a memory configured to store a collection of files; and a processor operatively coupled to the memory, the processor configured to generate a probabilistic counter data structure representing a frequency of a data feature in the collection of files, the processor configured to access a value of the probabilistic counter data structure by applying a set of hash functions to an indication of the data feature, the processor configured to generate a malware signature based on the probabilistic counter data structure, the malware signature including an indication of one or more criterion for the data feature, the malware signature associated with a malware, the processor configured to receive a target file, the processor configured to classify the target file as the malware when the target file meets the one or more criterion of the malware signature.
 2. The apparatus of claim 1, wherein the processor is further configured to: receive the collection of files; and send a signal to store the collection of files in the memory.
 3. The apparatus of claim 1, wherein the frequency of the data feature is a probabilistic count.
 4. The apparatus of claim 1, wherein the frequency of the data feature is a lossy count.
 5. The apparatus of claim 1, wherein the processor is further configured to filter the collection of files for the data feature.
 6. The apparatus of claim 1, wherein the processor is further configured to filter the collection of files for the data feature in a lossy manner.
 7. The apparatus of claim 1, wherein the processor is further configured to filter the collection of files for the data feature based on a data structure associated with the probabilistic counter data structure, the data structure including a set of data features including the data feature.
 8. The apparatus of claim 1, wherein the processor is further configured to: transform the collection of files to generate a set of transformed files; and filter the set of transformed files for the data feature based on a data structure associated with the probabilistic counter data structure, the data structure including the data feature.
 9. The apparatus of claim 1, wherein the processor is configured to generate the malware signature based on a likelihood that the data feature is indicative of the malware associated with the malware signature.
 10. The apparatus of claim 1, wherein the target file meets the one or more criterion based on at least one of: the data feature being in the target file; a frequency of the data feature in the target file; a proximity between the data feature and another data feature in the target file; or a relationship between the data feature and another data feature in the target file.
 11. The apparatus of claim 1, wherein the processor is further configured to generate the malware signature based on a frequency of the data feature in a subset of the collection of files.
 12. The apparatus of claim 1, wherein the one or more criterion indicates a measure of likelihood that the target file is malware.
 13. The apparatus of claim 1, wherein the one or more criterion includes a threshold criterion for a measure of likelihood that the target file is malware, the measure of likelihood including at least one of a qualitative measure, a binary measure, a probabilistic measure, or a percentage measure.
 14. The apparatus of claim 1, wherein the processor is further configured to transmit an indication of the classification of the target file as the malware.
 15. The apparatus of claim 1, wherein: the probabilistic counter data structure represents the frequency of the data feature in the collection of files as a logarithmic value of the frequency of the data feature; and the processor is further configured to modify the probabilistic counter data structure when an instance of the data feature is located in a file from the collection of files by modifying an exponent of the logarithmic value.
 16. An apparatus, comprising: a memory configured to store a collection of files; and a processor operatively coupled to the memory, the processor configured to: filter the collection of files for a data feature to generate a set of filtered files; generate a probabilistic counter data structure representing a frequency of a data feature in the set of filtered files; and access a value of the probabilistic counter data structure by applying a set of hash functions to an indication of the data feature; the processor configured to generate a malware signature based on the frequency of the data feature in the set of filtered files, the malware signature including one or more criterion for the data feature, the malware signature associated with a malware; the processor configured to receive a target file; and the processor configured to classify the target file as the malware when the target file meets the one or more criterion of the malware signature.
 17. The apparatus of claim 16, wherein the processor is further configured to: retrieve the collection of files from one or more source devices using at least one of crawling, tracking, or scraping; and store the collection of files to the memory.
 18. The apparatus of claim 16, wherein the frequency of the data feature is a lossy count.
 19. The apparatus of claim 16, wherein the processor is further configured to filter the collection of files for the data feature in a lossy manner.
 20. The apparatus of claim 16, wherein the processor is configured to filter the collection of files for the data feature in a lossy manner, the processor further configured to calculate the frequency of the data feature in the set of filtered files in a lossy manner.
 21. The apparatus of claim 16, wherein the processor is further configured to filter the collection of files for the data feature based on a data structure associated with the probabilistic counter data structure, the data structure including a set of data features, the set of data features including the data feature.
 22. The apparatus of claim 16, wherein the data feature is from a plurality of data features, the processor further configured to filter the collection of files for the data feature based on a plurality of probabilistic counter data structures, each probabilistic counter data structure from the plurality of probabilistic counter data structures being associated with a data structure, each data structure including a data feature from the plurality of data features.
 23. The apparatus of claim 16, wherein the processor is further configured to filter the collection of files by: transforming the collection of files to generate transformed files; and filtering the transformed files for the data feature based on a data structure associated with the probabilistic counter data structure, the data structure including the data feature.
 24. A non-transitory processor-readable medium storing code representing instructions to be executed by a processor, the code comprising code to cause the processor to: receive a collection of files; generate a probabilistic counter data structure representing a frequency of each data feature of a set of data features in the collection of files; access a value of the probabilistic counter data structure associated with each data feature from the set of data features by applying a set of hash functions to an indication of that data feature; receive a selection of malware files from the collection of files, the selection of malware files associated with a malware; calculate a frequency of each data feature of the set of data features in the selection of malware files; generate a malware signature based on the frequency of each data feature in the collection of files and based on the frequency of each data feature in the selection of malware files, the malware signature including an indication of a criterion for one or more data features of the set of data features, the malware signature associated with the malware; receive a target file; classify the target file as the malware when the target file meets the criterion of the malware signature; and transmit an indication of the classification of the target file as malware, the indication including one or more recommended actions.
 25. The non-transitory processor-readable medium of claim 24, wherein the code to cause the processor to generate the probabilistic counter data structure includes code to cause the processor to generate the probabilistic counter data structure using a Morris counter.
 26. The non-transitory processor-readable medium of claim 25, further comprising code to cause the processor to: calculate a likelihood that the target file is the malware, the code to cause the processor to transmit the indication of the classification of the target file as malware further including code to cause the processor to transmit an indication of the likelihood that the target file is the malware. 